﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ERP.Manager.DataProvider;
using ERP.Manager.DataEntity;
namespace ERP.Manager.BusinessServices
{
    public class ECS_goodsinfoService
    {
        private readonly IECS_goodsinfoRepository ecs_goodsinforepository;
        public ECS_goodsinfoService() { }
        public ECS_goodsinfoService(IECS_goodsinfoRepository ecs_goodsinforepository)
        {
            this.ecs_goodsinforepository = ecs_goodsinforepository;
        }
        #region 添加商品信息
        public int add_ecs_goods(ECS_goodsinfo ecs_goods)
        {
            return ecs_goodsinforepository.add_ecs_goods(ecs_goods);
        }
        #endregion

        #region 把商品放入到回收站中
        public int delete_ecs_goods(int goods_id)
        {
            return ecs_goodsinforepository.delete_ecs_goods(goods_id);
        }
        #endregion

        #region 修改商品信息
        public int update_ecs_goods(ECS_goodsinfo ecs_goods)
        {
            return ecs_goodsinforepository.update_ecs_goods(ecs_goods);
        }
        #endregion

        #region 根据商品分类编号查询商品
        public List<ECS_goodsinfo> all_ecs_goodsinfo_category_cat_id_page(int pagecount, int cat_id)
        {
            return ecs_goodsinforepository.all_ecs_goodsinfo_category_cat_id_page(pagecount, cat_id);
        }
        #endregion

        #region 分页查询所有商品信息
        public List<ECS_goodsinfo> all_ecs_goodsinfo_page(int pagecount)
        {
            return ecs_goodsinforepository.all_ecs_goodsinfo_page(pagecount);
        }
        #endregion

        #region 查询所有商品信息
        public List<ECS_goodsinfo> all_ecs_goodsinfo()
        {
            return ecs_goodsinforepository.all_ecs_goodsinfo();
        }
        #endregion

        #region 查询商品详细信息
        public ECS_goodsinfo detail_ecs_goods(int goods_id)
        {
            return ecs_goodsinforepository.detail_ecs_goods(goods_id);
        }
        #endregion

        #region 根据商品分类编号查询商品的所有记录的条数
        public int all_ecs_goodsinfo_category_cat_id_page_count(int cat_id)
        {
            return ecs_goodsinforepository.all_ecs_goodsinfo_category_cat_id_page_count(cat_id);
        }
        #endregion

        #region 查询所有商品信息的所有记录条数
        public int all_ecs_goodsinfo_page_count()
        {
            return ecs_goodsinforepository.all_ecs_goodsinfo_page_count();
        }
        #endregion

        #region 分页显示所有假删除的商品信息的方法
        public List<ECS_goodsinfo> all_ecs_goodsinfo_remove_page(int pagecount)
        {
            return ecs_goodsinforepository.all_ecs_goodsinfo_remove_page(pagecount);
        }
        #endregion

        #region 查询商品被删除的记录条数的方法
        public int all_ecs_goodsinfo_remove_page_count()
        {
            return ecs_goodsinforepository.all_ecs_goodsinfo_remove_page_count();
        }
        #endregion

        #region 还原商品的方法
        public int update_ecs_goodsinfo_remove(int goods_id)
        {
            return ecs_goodsinforepository.update_ecs_goodsinfo_remove(goods_id);
        }
        #endregion

        #region 删除商品信息的方法
        public int delete_ecs_goods_remove(int goods_id)
        {
            return ecs_goodsinforepository.delete_ecs_goods_remove(goods_id);
        }
        #endregion

        #region 搜索 根据品牌、商品名称查询商品信息
        public List<ECS_goodsinfo> search_all_ecs_goodsinfo_page(int pagecount, int brand_id, string goods_name, string begin_time, string end_time)
        {
            return ecs_goodsinforepository.search_all_ecs_goodsinfo_page(pagecount, brand_id, goods_name,begin_time,end_time);
        }
        #endregion

        #region 根据查询品牌、商品名称得到总共记录
        public int search_all_ecs_goodsinfo_page_count(int brand_id, string goods_name, string begin_time, string end_time)
        {
            return ecs_goodsinforepository.search_all_ecs_goodsinfo_page_count(brand_id, goods_name,begin_time,end_time);
        }
        #endregion

        #region 修改商品库存的数量的方法
        public int update_ecs_goods_number(int goods_id, int goods_number)
        {
            return ecs_goodsinforepository.update_ecs_goods_number(goods_id, goods_number);
        }
        #endregion
    }
}
